package com.rc.saas.tenant.service.rc;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.mapper.rc.RcOperatorAccountMapper;
import com.rc.saas.tenant.model.rc.RcOperatorAccount;
import com.rc.saas.tenant.model.rc.RcOperatorAccountExample;
import com.rc.saas.tenant.search.rc.RcOperatorAccountSearch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class RcOperatorAccountServiceImpl implements RcOperatorAccountService {

    @Autowired
    private RcOperatorAccountMapper operatorAccountMapper;

    @Override
    public RcOperatorAccountMapper getMapper() {
        return operatorAccountMapper;
    }

    @Override
    public PageInfo<RcOperatorAccount> listPageByCondition(RcOperatorAccountSearch RcOperatorAccountSearch) {
        PageHelper.startPage(RcOperatorAccountSearch.getOffset(), RcOperatorAccountSearch.getLimit());
        List<RcOperatorAccount> operatorAccountList =  operatorAccountMapper.listPageByCondition(RcOperatorAccountSearch);
        return new PageInfo<RcOperatorAccount>(operatorAccountList);
    }

    @Override
    public List<RcOperatorAccount> selectOperatorAccount() {
        return operatorAccountMapper.selectByExample(new RcOperatorAccountExample());
    }
}
